/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator;

import lombok.*;

/**
 * @author peng-yongsheng
 */
// SegmentCoreInfo 是一个 POJO，用于记录解析 TraceSegment 时产生的核心数据，作用类似于一个 DTO
// （各个 SpanListener 都会从它这里拷贝 TraceSegment 的数据）
@Getter
@Setter
public class SegmentCoreInfo {
    // TraceSegment 编号，即 TraceSegment.traceSegmentId
    private String segmentId;
    // Segment 所属的 Service 以及 ServiceInstance
    private int serviceId;
    private int serviceInstanceId;
    // Segment 的开始时间和结束时间
    private long startTime;
    private long endTime;
    // 如果 TraceSegment 范围内的任意一个 Span 被标记了 Error，则该字段会被设置为true
    private boolean isError;
    // TraceSegment 开始时间窗口(即第一个 Span 开始时间所处的分钟级时间窗口)
    private long minuteTimeBucket;
    // 整个 TraceSegment 的字节数据
    private byte[] dataBinary;
    // 是否为 V2 版本的 TraceSegment 数据
    private boolean isV2;
}
